package mysql

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	gorm.Model
	Mobile   string `gorm:"type:varchar(30);comment:手机号"`
	Password string `gorm:"type:varchar(50);comment:密码"`
	HeadImg  string `gorm:"type:varchar(500);comment:头像"`
	Name     string `gorm:"type:varchar(30);comment:名称"`
}
type House struct {
	gorm.Model
	Title  string  `gorm:"type:varchar(30);comment:标题"`
	Price  float64 `gorm:"type:decimal(10,2);comment:价格"`
	Rent   float64 `gorm:"type:decimal(10,2);comment:租金"`
	Area   int     `gorm:"type:int(30);comment:面积"`
	City   string  `gorm:"type:varchar(30);comment:城市"`
	Way    string  `gorm:"type:varchar(30);comment:租赁方式"`
	UserId int     `gorm:"type:int(30);comment:用户id"`
}
type Res struct {
	gorm.Model
	UserId  int       `gorm:"type:int(30);comment:用户id"`
	HouseId int       `gorm:"type:int(30);comment:房源id"`
	ResTime time.Time `gorm:"type:datetime(3);comment:预约时间"`
	Statue  string    `gorm:"type:varchar(30);comment:状态"`
}
type ResData struct {
	Res
	Name   string `gorm:"type:varchar(30);comment:姓名"`
	Mobile string `gorm:"type:varchar(30);comment:手机号"`
	City   string `gorm:"type:varchar(30);comment:地址"`
	Title  string `gorm:"type:varchar(30);comment:户型"`
	Area   int    `gorm:"type:int(30);comment:面积"`
}
type Ask struct {
	gorm.Model
	UserId  int    `gorm:"type:int(30);comment:用户id"`
	HouseId int    `gorm:"type:int(30);comment:房源id"`
	Content string `gorm:"type:varchar(30);comment:咨询内容"`
}
